import java.io.*;

/**
 *
 * @author brett
 */
public class ProvenanceAdapter {
    private String fileName =  "test_heatwave_output.txt";
    
    
    public ProvenanceAdapter() {
        
    }
    
    public boolean writeToStorage(String writeMe){

        try {
            // Assume default encoding.
            FileWriter fileWriter =
                new FileWriter(fileName, true);

            // Always wrap FileWriter in BufferedWriter.
            BufferedWriter bufferedWriter =
                new BufferedWriter(fileWriter);

            // Note that write() does not automatically
            // append a newline character.
            bufferedWriter.write(writeMe);
            bufferedWriter.newLine();


            // Always close files.
            bufferedWriter.close();
        }
        catch(IOException ex) {
            System.out.println(
                "Error writing to file '"
                + fileName + "'");
            return false;
            // Or we could just do this:
            // ex.printStackTrace();
        }
        
        return true;
    }
    
}
